import { defineStore } from 'pinia'

export const useKeepAliveStore = defineStore('keep-alive', {
  state: () => ({
    cachedNames: []
  }),
  actions: {
    add(name) {
      this.cachedNames.push(name)
    },
    replace(name) {
      this.cachedNames = [name]
    },
    clear() {
      this.cachedNames = []
    }
  }
})
